<template>
	<view class="wrong" v-if="requestStatus">
		<image class="icon" :src="image" mode="widthFix"></image>
		<view class="tips">{{tips}}</view>
		<view class="retry" @click="retry">点我重试</view>
	</view>
</template>

<script>
	export default {
		name: "wrongNetwork",
		props: {
			// 页面文字提示
			tips: {
				type: String,
				default: '哎呀，网络信号丢失'
			},
			// image 没有网络的图片提示
			image: {
				type: String,
				default: ""
			},
			// 请求结果
			requestStatus: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {

			}
		},
		methods: {
			// 重试
			retry() {
				this.$emit('click')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.wrong {
		background-color: $--color-bg-0;
		display: flex;
		flex-flow: column nowrap;
		justify-content: center;
		align-items: center;
		height: 100%;
		width: 100vw;
		position: absolute;
		top: 0;
		left: 0;
		z-index: 999;
	}

	.tips {
		color: $--color-Text-3;
		font-size: 28rpx;
		padding: 30rpx 0;
	}

	.icon {
		width: 300rpx;
	}

	.retry {
		background-color: $--color-Gold;
		color: $--color-Text-1;
		padding: 10rpx 60rpx;
		border-radius: 10rpx;
	}
</style>
